package com.weishaoying.example.base.aop;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author WeiShaoying
 * @date 2018/4/3
 */
public class AopMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JavaConfig.class);
        DogService dogService = context.getBean(DogService.class);
        dogService.eat(2, "骨头");
        dogService.watch();
        dogService.run(20);
        UserService userService = context.getBean(UserService.class);
        userService.saveUser();
        context.close();
    }
}
